﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<WRSManagementSystem.DomainModel.Entities.Project>>" %>

<%@ Import Namespace="WRSManagementSystem.DomainModel.Entities" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Projekty</h2>
    <table>
        <tr>
            <th>
            </th>
            <th>
                Nazwa
            </th>
            <th>
                Koordynator
            </th>
            <th>
                Początek
            </th>
            <th>
                Koniec
            </th>
        </tr>
        <%
            foreach (Project item in Model)
            {%>
        <tr>
            <td>
                <%=Html.ActionLink("Edytuj", "../Project/Edit", new {id = item.Id})%>
                |
                <%=Html.ActionLink("Szczegóły", "../Project/Details", new {id = item.Id})%>
            </td>
            <%--            <td>
                <%= Html.Encode(item.Id) %>
            </td>--%>
            <td>
                <%=Html.Encode(item.Name)%>
            </td>
            <td>
                <%=Html.Encode(item.Creator.Name + " " + item.Creator.Surname)%>
            </td>
            <td>
                <%=Html.Encode(String.Format("{0:g}", item.StartDate))%>
            </td>
            <td>
                <%=Html.Encode(String.Format("{0:g}", item.EndDate))%>
            </td>
        </tr>
        <%
            }%>
    </table>
    <p>
        <%=Html.ActionLink("Utwórz nowy projekt", "../Project/Create")%>
    </p>
    <fieldset>
        <legend>Wyszukiwanie</legend>
        <% using (Html.BeginForm("Report", "Project")) %>
        <% { %>
        <div class="editor-label">
            <%=Html.Label("Koordynator")%>
        </div>
        <div class="editor-field">
            <%= Html.DropDownList("creatorsDropDownList", ViewData["Creators"] as SelectList) %>
        </div>
        <br />
        <input type="submit" value="Pokaż" />
        <% } %>
    </fieldset>
</asp:Content>
